{% extends "in_base.html" %}
{% block content %}

<div class="loginmain" style="padding-bottom: 50px;">
    <div class="login-title">
        <span>Department of dim</span>
<!--        <span>归舟</span>-->
    </div>

    <div class="login-con">
        <form id="login_form" onsubmit="return" method="post" action="">
            <input type='hidden' name='md5_pwd' id='md5_pwd' value=''/>
            <div class="login-user">
                <div class="icon">
                    <img src="{{url_for('static',filename='image/user_icon_copy.png')}}" >
                </div>
                <input type="text" name="account" placeholder="phone number" autocomplete="off" value="" id="account">
<!--                <input type="text" name="account" placeholder="手机号" autocomplete="off" value="" id="account">-->
                <p class="var_text" id="account_" hidden></p>
            </div>
            <div class="login-pwd">
                <div class="icon">
                    <img src="{{url_for('static',filename='image/lock_icon_copy.png')}}" >
                </div>
                <input type="password" name="pwd" placeholder="password" autocomplete="off" id="pwd" value="">
<!--                <input type="password" name="pwd" placeholder="密码" autocomplete="off" id="pwd" value="">-->
                <p class="var_text" id="pwd_" hidden></p>
                <p class="var_text">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="checkbox" id="rember" style="width:100" check="true">Remember me</p>
<!--                <p class="var_text">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="checkbox" id="rember" style="width:100" check="true">记住我</p>-->
                <p class="var_find" id="find_pwd" >&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<a href="{{url_for('find_pwd')}}" style="color:#D3D7F7">Phone number login</a></p>
<!--                <p class="var_find" id="find_pwd" >&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<a href="{{url_for('find_pwd')}}" style="color:#D3D7F7">手机验证码登录</a></p>-->

            </div>
            <div class="login-btn">
                <input type="button" value="Login" onclick="validateLoginForm()">
<!--                <input type="button" value="登录" onclick="validateLoginForm()">-->
            </div>
        </form>
        <br>
        <br>
        <br>
        <div class="login-btn">
            <a href="{{url_for('sign')}}"><input type="button" value="Sign"></a>
<!--            <a href="{{url_for('sign')}}"><input type="button" value="注册"></a>-->
        </div>
        <br>
        <br>
        <br>
    </div>

</div>
<script>
	window.onload = function(){
		var name = document.getElementById("account");
		var dl = document.getElementById("dl");
		var orember = document.getElementById("rember");
		//页面初始化时，如果帐号密码cookie存在则填充
		if(getCookie('account')){
			name.value = getCookie('account');
			orember.checked = true;
		}
		//复选框勾选状态发生改变时，如果未勾选则清除cookie
		orember.onchange = function(){
			if(!this.checked){
				delCookie('account');
				delCookie('password');
			}
		}
    //获取cookie
		function getCookie(name){
			var reg = RegExp(name+'=([^;]+)');
			var arr = document.cookie.match(reg);
			if(arr){
			  return arr[1];
			}else{
			  return '';
			}
		 };

    //删除cookie
		function delCookie(name){
			setCookie(name,null,-1);
		 }
    }
</script>
{% endblock %}